﻿<h2>Grouping nodes by NodeType</h2>
@{
  var root = Model.AncestorOrSelf(1);
  var dataTypesRoot = root.Children.Where("NodeTypeAlias == \"DatatypesFolder\"").FirstOrDefault();

  var dataTypesByType = dataTypesRoot.Children.GroupBy("NodeTypeAlias");

  foreach (var dataTypeGroup in dataTypesByType)
  {
    <h3>NodeTypeAlias: @dataTypeGroup.Key</h3> 
 
    foreach (var node in dataTypesRoot.Children.Where("NodeTypeAlias == \"" + dataTypeGroup.Key + "\""))
    {
      <span>NodeName: @node.Name (Node Id: @node.Id)</span><br />
    }
  }
}